package com.heima.search.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.search.dto.ApArticleSearchDto;
import com.heima.search.entity.ApAssociateWords;
import com.heima.search.service.IArticleAssociateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/v1/associate")
public class ArticleAssociateController {
    @Autowired
    private IArticleAssociateService articleAssociateService;

    /**
     * 联想分页查询
     * @param dto
     * @return
     */
    @PostMapping("/search")
    public ResponseResult<List<ApAssociateWords>> associate(@RequestBody ApArticleSearchDto dto){
        return articleAssociateService.associate(dto);
    }
}
